GXCopyToViewPort
You can use theGXCopyToViewPort
function to create a copy of an existing view port object.
gxViewPort GXCopyToViewPort(gxViewPort target, gxViewPort source);
target
- A reference to the view port to copy the source contents into. If you specify
nil
for this parameter, theGXCopyToViewPort
function creates a new view port object.source
- A reference to the view port whose contents you want to copy.
- function result
- A reference to the copy (that is, the target view port) of the source view port.
DESCRIPTION
TheGXCopyToViewPort
function copies the contents of an existing view port object to another, or it creates a new view port object and copies the contents of an existing view port object to it. The function copies the clip, mapping, dither, halftone, attributes, and tag list (but not the parent or child view ports) of the view port object specified by thesource
parameter into the view port object specified by thetarget
parameter. It clones, but does not copy, the tag objects in the tag list. The target view port is placed in the same view group as the source view port. The target view port is not associated with any window, whether or not the source view port is associated with one.If you specify
nil
for thetarget
parameter, theGXCopyToViewPort
function creates a new view port object and copies the source properties into it.You can use the
GXCopyToViewPort
function to create a copy of a view port object and then modify it without changing the original.SPECIAL CONSIDERATIONS
If you specifynil
for thetarget
parameter and no error occurs, theGXCopyToViewPort
function creates a view port object; you are responsible for disposing of that object when you no longer need it.ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory invalid_viewPort_reference viewPort_is_a_window (debugging version) SEE ALSO
For an example of the use of this function, see Listing 7-2 on page 7-44.To create a new view port that has default values instead of being a copy of an existing view port, use the
GXNewViewPort
function, described on page 7-70.To compare two view port objects for equality, use the
GXEqualViewPort
function, described in the next section.